import { reqGetArticle } from '../../api/index'

const state = {
  type: 1,
  travelnotelist: [],
}

const actions = {
  async getArticle({ commit }, data) {
    let { type, limit, page } = data
    // console.log(type, limit, page)
    let res = await reqGetArticle({ type, limit, page })
    // console.log(res.data.travelnotelist)
    commit('GET_ARTICLE', { type, travelnotelist: res.data.travelnotelist })
  },
}
const mutations = {
  GET_ARTICLE(state, data) {
    state.type = data.type
    state.travelnotelist = data.travelnotelist
  },
}
const getter = {}

export default {
  namespaced: true,
  state,
  actions,
  mutations,
  getter,
}
